<?php
namespace app\index\controller;

use app\index\model\appInfo as AppInfoModel;
use app\index\model\appKind as AppKindModel;

use app\index\controller\JsonData;

class AppInfo extends JsonData
{
    //获取应用的主题信息，等
    public function getAppInfo()
    {
        $appInfo = AppInfoModel::getById(1);
        unset($appInfo["appId"]);
        unset($appInfo["appSecret"]);
        $json = $this->getJsonData(0, "success", $appInfo);
        return $json;
    }
    //获取应用设置的分类
    public function getAppKind()
    {
        $appKind = AppKindModel::all(function ($query) {
            $query->where('id', '>', 0);
        });
        $json = $this->getJsonData(0, "success", $appKind);
        return $json;
    }
}